package com.woniuxy.itconst;

import lombok.extern.slf4j.Slf4j;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO:
 * <P> Date: 2022/4/10:10:24
 * <P> Description:
 */
@Slf4j(topic = "c.ItconstTest1")
@SuppressWarnings("all")
public class ItconstTest1 {
    public static void main(String[] args) {
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                try {
                    log.debug("{}", df.parse("1951-04-21"));
                } catch (Exception e) {
                    log.error("{}", e);
                }
            }).start();
        }
    }

    public void test1() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                try {
                    synchronized (ItconstTest1.class) {
                        log.debug("{}", sdf.parse("1951-04-21"));
                    }
                } catch (Exception e) {
                    log.error("{}", e);
                }
            }).start();
        }
    }
}
